package com.hermeneute.fsa;

import java.util.Iterator;

public class FSTTransitionIterator {
    Iterator it;
    FSTTransition tr;
    boolean more;

    FSTTransitionIterator (Iterator i) {
	it = i;
	tr = null;
    }

    FSTTransition getTransition() {
	return tr;
    }

    FSTEvent getEvent() {
	if (tr != null) {
	    return tr.getEvent();
	} else {
	    return null;
	}
    }
    
    int getState() {
	if (tr != null) {
	    return tr.getState();
	} else {
	    return 0;
	}
    }

    void remove () {
	if (it != null) {
	    it.remove();
	}
    }

    boolean hasNext() {
	//return more;
	if (it != null) {
	    return it.hasNext();
	} else {
	    return false;
	}
    }

    void next() {
	if (it != null) {
	    //more = it.hasNext();
	    tr = (FSTTransition) it.next();
	}
    }
}
